// 亚善船舶工序能源数据采集

import * as flow from "./flow";

// 工序一级Table
export const workColumns = {
  0: [
    ...flow.commonColumns,
    {
      title: "部件",
      dataIndex: "component",
      key: "component",
    },
    {
      title: "厚度(mm)",
      dataIndex: "weight",
      key: "weight",
    },
    {
      title: "宽度(mm)",
      dataIndex: "width",
      key: "width",
    },
    {
      title: "长度(mm)",
      dataIndex: "length",
      key: "length",
    },
    {
      title: "数量",
      dataIndex: "num",
      key: "num",
    },
    {
      title: "下料面积(m²)",
      dataIndex: "area", // 动态计算 ((width+length)*2*weight)/1000000
      key: "area",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "单位电能标定值",
      dataIndex: "powerByUnit", //动态计算 固定值
      key: "powerByUnit",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "用电量",
      dataIndex: "powers", // 动态计算 area*powerByUnit
      key: "powers",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "单位耗氧气量标定值",
      dataIndex: "o2ByUnit", //动态计算 固定值
      key: "o2ByUnit",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "耗氧气量(m³)",
      dataIndex: "o2", // 动态计算 area*o2ByUnit
      key: "o2",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "单位压缩空气标定值",
      dataIndex: "airByUnit", //动态计算 固定值
      key: "airByUnit",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "耗压缩空气量(m³)",
      dataIndex: "air", // 动态计算 area*airByUnit
      key: "air",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
  ],
  1: flow.workColumns["1"],
  2: flow.workColumns["2"],
  3: flow.workColumns["3"],
  4: flow.workColumns["4"],
  "5-0": flow.workColumns["5-0"],
  "5-1": flow.workColumns["5-1"],
  "6-0": flow.workColumns["6-0"],
  "7-0": flow.workColumns["7-0"],
  8: flow.workColumns["8"],
  9: flow.workColumns["9"],
};

// 工序二级Table
export const innerColumns = {
  8: flow.innerColumns["8"],
};
